package com.leigang.java.code.design.mode.strategy;

import java.util.HashMap;
import java.util.Map;

public class PaymentStrategyFactory {
    private Map<String, PaymentStrategy> strategies = new HashMap<>();

    public void registerStrategy(String name, PaymentStrategy strategy) {
        strategies.put(name, strategy);
    }

    public PaymentStrategy getStrategy(String name) {
        return strategies.get(name);
    }
}
